package com.coldchain.cys.config.converter;

import java.text.SimpleDateFormat;
import java.util.Date;

import org.springframework.core.convert.converter.Converter;
import org.springframework.stereotype.Component;

import cn.hutool.core.date.DateUtil;

@Component
public class DateConverter implements Converter<String, Date>{

	@Override
	public Date convert(String source) {
		 //1. 定义日期格式
		try {
			Date date = DateUtil.parseDate(source).toJdkDate();
			return date ;
		} catch (Exception e) {
		}
		return null ;
	}

}
